package com.ruoyi.domain;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Component
@FeignClient(contextId = "novelFeignService",value= ServiceNameConstants.NOVEL_SERVICE)
public interface NovelFeignService {
    /**
     * 根据小说标题获取小说详情
     * @param title
     * @return
     */
    @GetMapping(value = "/read/getNovelContent")
    public AjaxResult getNovelContent(@RequestParam("title") String title);

    /**
     * 根据小说标题获取章节详情
     */
    @GetMapping(value = "/read/getNovelChapter")
    public TableDataInfo getNovelChapter(@RequestParam("title") String title);

    /**
     * 上传小说封面
     */
    @PostMapping(value ="/oss/show")
    public String show(@RequestBody MultipartFile file);

    /**
     * 根据小说标题获取小说内容详情
     */
    @GetMapping(value = "/chapter/content")
     TableDataInfo getContent(@RequestParam("title") String title);

    /**
     * 根据小说标题、小说章节获取小说章节内容
     */
    @GetMapping(value = "/chapter/content")
    public AjaxResult getContent(@RequestParam("title") String novelName,@RequestParam("orderNum") String orderNum);
}
